﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace NinjaToolbox
{
    public class PhysicsSystemExample : MonoBehaviour
    {
        public CapsuleShape capsuleShape;
        public BoxShape boxShape;
        public SphereShape sphereShape;


        void OnDrawGizmos()
        {
            if (capsuleShape == null || boxShape == null || sphereShape == null) return;

            var referencePoint = default(Vector3);
            var isHit = capsuleShape.IsHit(boxShape, out referencePoint);

            if (isHit)
            {
                Gizmos.DrawWireSphere(referencePoint, 0.2f);
            }

            referencePoint = default(Vector3);
            isHit = capsuleShape.IsHit(sphereShape, out referencePoint);

            if (isHit)
            {
                Gizmos.DrawWireSphere(referencePoint, 0.2f);
            }

            referencePoint = default(Vector3);
            isHit = boxShape.IsHit(sphereShape, out referencePoint);

            if (isHit)
            {
                Gizmos.DrawWireSphere(referencePoint, 0.2f);
            }
        }
    }
}
